package work.chenxr.websocket.service.impl;

import lombok.AllArgsConstructor;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Service;
import work.chenxr.websocket.endpoint.WebSocketServerEndpoint;
import work.chenxr.websocket.service.WebSocketService;

/**
 * @Author Chenxr
 * @Date 2023/10/21
 * @Description
 */
@Service
@EnableScheduling
@AllArgsConstructor
public class WebSocketServiceImpl implements WebSocketService {
    private final WebSocketServerEndpoint webSocketServerEndpoint;

    @Override
    public void sendMsg(String userId, String content) {
        webSocketServerEndpoint.sendInfo(content, userId);
    }
}
